import Controller from "./Controller";
import {Request,Response} from 'express';
import Config from "../Config";
import Fs from 'fs-extra';
import path from "path";
/**
 * 组件
 */
class Components extends Controller
{
    constructor(req?:Request,res?:Response) {
        super(req,res);
    }

    /**
     * 获取所有组件
     */
    getAll()
    {
        const components_json_path = path.join(
            Config.root_dir,
            "components",
            "components.json"
        );
        this.response(200,Fs.readJSONSync(components_json_path))
    } 
}

export default Components